<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>商品信息</title>
</head>
<body>
    <form th:action="@{/itemCategory}" th:object="${itemCategory}" method="post">
        <h1 th:if="${itemCategory.id == null}">新增商品</h1>
        <div th:if="${itemCategory.id!=null}">
            <h1>修改商品</h1>
            <input type="hidden" th:field="*{id}">
            <input type="hidden" name="_method" value="put">
        </div>
        <p>分类名称:<input type="text" th:field="*{name}"><span th:errors="*{name}"></span></p>
        <p>上级分类id<input type="text" th:field="*{pid}"><span th:errors="*{pid}"></span></p>
        <p>分类说明<input type="text" th:field="*{remark}"><span th:errors="*{remark}"></span></p>
        <button>保存</button>
    </form>

</body>
</html>